<!--
	作者：568452976@qq.com
	时间：2017-05-19
	描述：调用flash 中的方法， flash调用JS中的方法
-->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script type="text/javascript" src="js/swfobject.js"></script>
		<script type="text/javascript">
			//初始化参数
			var flashvars = {
				name1: "hello",
				name2: "world",
				name3: "foobar"
			};
			
			//flash系统参数
			var params = {};
			params.wmode = "transparent";
			params.quality = "high";
			params.allowfullscreen = "false";
			params.allowscriptaccess = "always";
			
			//自定义标签
			var attributes = {
				title:'JS调用Flash'
			};
			swfobject.embedSWF("swf/Demo1.swf", "FlashID", "550", "400", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

			//改变内容
			function changeContent() {
				thisMovie("FlashID").changeContent("改变内容");
			}

			//搭建js与flash互通的环境
			function thisMovie(movieName) {
				if(navigator.appName.indexOf("Microsoft") != -1) {
					return window[movieName];
				} else {
					return document[movieName];
				}
			}
			
			//提供给flash的方法
			function showDialog(info){
				alert(info);
			}
		</script>
	</head>

	<body>

		
		<div id="FlashID">
			<h1>Alternative content</h1>
			<p>
				<a href="http://www.adobe.com/go/getflashplayer">
					<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>
			</p>
		</div>
		<input type="button" onclick="changeContent()" value="改变内容"></input>
	</body>

</html>